//
//  ZSPSearchMoreViewCell.m
//  ZSP_IOS
//
//  Created by Bruce on 2019/10/7.
//  Copyright © 2019 mlqk. All rights reserved.
//

#import "ZSPSearchMoreViewCell.h"
@interface ZSPSearchMoreViewCell ()
@property (nonatomic,strong) UIView *mainView;
@end
@implementation ZSPSearchMoreViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self loadView];
    }
    
    return self;
}

- (void)loadView {
    
    [self.contentView addSubview:self.mainView];
    [self.mainView addSubview:self.searchImageView];
    [self.mainView addSubview:self.moreLabel];
    
    
    [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.contentView);
        make.height.mas_equalTo(20);
        
    }];
    
    [self.searchImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.centerY.equalTo(self.mainView);
        make.size.mas_equalTo(CGSizeMake(12, 12));
    }];
    [self.moreLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.searchImageView.mas_right).offset(5);
        make.centerY.equalTo(self.mainView);
        make.height.equalTo(@17);
        
        make.right.equalTo(self.mainView);
    }];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

- (UIView *)mainView
{
    if (!_mainView) {
        UIView *view = [[UIView alloc] init];
        view.userInteractionEnabled = NO;
        _mainView = view;
    }
    return _mainView;
}
- (UIImageView *)searchImageView
{
    if (!_searchImageView) {
        UIImageView *imageView = [[UIImageView alloc] init];
        imageView.image = [UIImage imageNamed:@"Search_More_Gender"];
        
        _searchImageView = imageView;
    }
    return _searchImageView;
}
- (UILabel *)moreLabel
{
    if (!_moreLabel) {
        UILabel *label = [[UILabel alloc] init];
        label.font = [UIFont systemFontOfSize:12];
        label.textColor = [UIColor colorWithRed:182/255.0 green:182/255.0 blue:182/255.0 alpha:1];
        _moreLabel = label;
    }
    return _moreLabel;
}
@end
